﻿//using Abp.Mvc;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Net.Http;
//using System.Text;
//using System.Threading.Tasks;
//using System.Web.Http.Controllers;
//using System.Web.Http.Filters;

//namespace Abp.WebApi
//{
//    class HandlerValidationAttribute: ActionFilterAttribute
//    {
//        public override void OnActionExecuting(HttpActionContext actionContext)
//        {
//            if (actionContext.ModelState.IsValid)
//            {
//                var data= new AjaxResult() { state= ResultType.error, message="数据验证错误",data=actionContext.ModelState.Values.Select(info=>info.Errors)};
//                var response=new HttpResponseMessage(System.Net.HttpStatusCode.OK);
//                response.Content = new StringContent(data.ToJson(), Encoding.UTF8, "text/html");
//                actionContext.Response = response;
//                return;
//            }
//            base.OnActionExecuting(actionContext);
//        }
//    }
//}
